﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace Agresso.Interface.Layer.Domain
{
    public class jGRNDetails
    {
        public int jGRNDetailsID;// int IDENTITY(1,1) NOT NULL,
        public string VslCode;// varchar(5) NULL,
        public string PoNo;// varchar(20) NULL,
        public long ArrivalID;// bigint NULL,
        public int PoLineItemNo;//int NULL,
        public decimal QtyReceived;// float NULL,
        public string LineItemComment;// varchar(80) NULL,
        public DateTime AddedOn;// datetime NULL,
        public int PickedUpFlag;// int NULL,
        public DateTime PickedUpAt;// datetime NULL,
        public long AgressoRowId;// bigint NULL,
        public jGRNDetails(SqlDataReader rd)
        {

            jGRNDetailsID = rd["jGRNDetailsID"] is DBNull ? jGRNDetailsID : Convert.ToInt32(rd["jGRNDetailsID"]);
            VslCode = rd["VslCode"] is DBNull ? VslCode : rd["VslCode"].ToString();
            PoNo = rd["PoNo"] is DBNull ? PoNo : rd["PoNo"].ToString();
            ArrivalID = rd["ArrivalID"] is DBNull ? ArrivalID : Convert.ToInt32(rd["ArrivalID"]);
            PoLineItemNo = rd["PoLineItemNo"] is DBNull ? PoLineItemNo : Convert.ToInt32(rd["PoLineItemNo"]);
            QtyReceived = rd["QtyReceived"] is DBNull ? QtyReceived : Convert.ToDecimal(rd["QtyReceived"]);
            LineItemComment = rd["LineItemComment"] is DBNull ? LineItemComment : rd["LineItemComment"].ToString();
            AddedOn = rd["AddedOn"] is DBNull ? AddedOn : Convert.ToDateTime(rd["AddedOn"]);
            PickedUpFlag = rd["PickedUpFlag"] is DBNull ? PickedUpFlag : Convert.ToInt32(rd["PickedUpFlag"]);
            PickedUpAt = rd["PickedUpAt"] is DBNull ? PickedUpAt : Convert.ToDateTime(rd["PickedUpAt"]);
            AgressoRowId = rd["AgressoRowId"] is DBNull ? AgressoRowId : Convert.ToInt32(rd["AgressoRowId"]);
        }
    }
}
